    const input = document.getElementById('input');
    const parseButton = document.getElementById('parse-button');
    const resetButton = document.getElementById('reset-button');
    const tableContainer = document.getElementById('table-container');
    const table = document.getElementById('table');

    parseButton.addEventListener('click', () => {
      const csvText = input.value.trim();
      const rows = csvText.split('\n');
      
      // Clear previous table content
      table.innerHTML = '';
      
      // Create table header
      const headerRow = document.createElement('tr');
      const headers = rows[0].split(',');
      
      for (let i = 0; i < headers.length; i++) {
        const headerCell = document.createElement('th');
        headerCell.textContent = headers[i];
        headerRow.appendChild(headerCell);
      }
      
      table.appendChild(headerRow);
      
      // Create table body
      for (let i = 1; i < rows.length; i++) {
        const dataRow = document.createElement('tr');
        const data = rows[i].split(',');
        
        for (let j = 0; j < data.length; j++) {
          const dataCell = document.createElement('td');
          dataCell.textContent = data[j];
          dataRow.appendChild(dataCell);
        }
        
        table.appendChild(dataRow);
      }
      
      // Show table and hide input and parse button
      tableContainer.style.display = 'block';
      input.style.display = 'none';
      parseButton.style.display = 'none';
      
      // Show reset button
      resetButton.style.display = 'block';
    });

    resetButton.addEventListener('click', () => {
      // Hide table and show input and parse button
      tableContainer.style.display = 'none';
      input.style.display = 'block';
      parseButton.style.display = 'block';
      
      // Hide reset button
      resetButton.style.display = 'none';
      
      // Clear input and table content
      input.value = '';
      table.innerHTML = '';
    });

    table.addEventListener('click', (event) => {
      if (event.target.tagName === 'TD') {
        // 获取单元格的文本内容
        const text = event.target.innerText;

        // 创建一个临时的textarea元素
        const tempTextArea = document.createElement('textarea');
        tempTextArea.value = text;
        document.body.appendChild(tempTextArea);

        // 选中textarea中的文本内容
        tempTextArea.select();

        // 将文本内容复制到剪贴板
        document.execCommand('copy');

        // 删除临时的textarea元素
        document.body.removeChild(tempTextArea);
      }
    });